package zhengqc.queue;

import zhengqc.list.ArrayList;

public class ArrayQueue<E> extends AbstractQueue<E> {
    public ArrayQueue() {
        this.data = new ArrayList<>();
    }

    @Override
    public String toString() {
        int size = data.getSize();
        StringBuilder sb = new StringBuilder();
        sb.append("ArrayQueue: size=").append(size).append(", content={front->[");
        for (int i = 0; i < size; ++i) {
            sb.append(data.get(i));
            if (i != size-1) {
                sb.append(", ");
            }
        }
        sb.append("]<-rear");
        return sb.toString();
    }
}
